-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SGR 58/59 (underline coloring) #15599
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
const auto r = GetRValue(color); | ||
const auto g = GetGValue(color); | ||
const auto b = GetBValue(color); | ||
return _WriteFormatted(FMT_COMPILE("\x1b[58;2;{};{};{}m"), r, g, b); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these use colon-separated subparameters? So as to minimise the risk that applications ignorant of underline colors treat the RGB numbers as separate attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean, may be we can do only :
instead, but that would require removing the invalidation of :
as a CSI parameter delimiter (conditionally). Thanks for the heads up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it's blocked by #4321.
I guess, this comment explains the blinking issue, and why we need to prefer using |
Adds support for colon `:` separated sub parameters in parser. Technically, after this PR, nothing should change except, now sub parameters are parsed, stored safely and we don't invalidate the whole sequence when a `:` is received within a parameter substring. In this PR: - If sub parameters are detected with a parameter, but the usage is unrecognised, we simply *skip* the parameter in `adaptDispatch`. - A separate store for sub parameters is used to avoid too many changes to the codebase. - We currently allow up to `6` sub parameters for each parameter, extra sub parameters are *ignored*. - Introduced `VTSubParameters` for easy access to underlying sub parameters. > **Info**: We don't use sub parameters for any feature yet, this is just the core implementation to support newer usecases. ## Validation Steps Performed - [x] Use of sub parameters must not have any effect on the output. - [x] Skip parameters with unexpected set of sub parameters. - [x] Skip sequences with unexpected set of sub parameters. References #4321 References #7228 References #15599 References xtermjs/xterm.js#2751 Closes #4321
closing this in favour of: #15795 |
Summary of the Pull Request
Adds support for underline coloring with SGR 58/59 sequences. ConPTY can now parse, store and send those sequences across console applications and client terminal app.
Tested it on Wezterm which already has support for drawing colored underlines. For testing, I replaced the prebundled
OpenConsole.exe
andconpty.dll
from Wezterm with the modified versions.Above code produces output like so:
Left: Wezterm, Right: WindowsTerminal Dev
Changes aren't visible on WindowsTerminal as of now. Atleast one of the graphic render, E.g. AtlasEngine, needs to support coloring of underline and drawing them on screen. Will be working on this in next few days.
References and Relevant Issues
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
PR Checklist